Integrand size = 31, antiderivative size = 143 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {(7 A-4 B) x}{2 a^2}-\frac {2 (8 A-5 B) \sin (c+d x)}{3 a^2 d}+\frac {(7 A-4 B) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(8 A-5 B) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2} \]
[Out]
Time = 0.47 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {4105, 3872, 2715, 8, 2717} \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=-\frac {2 (8 A-5 B) \sin (c+d x)}{3 a^2 d}+\frac {(7 A-4 B) \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {(8 A-5 B) \sin (c+d x) \cos (c+d x)}{3 a^2 d (\sec (c+d x)+1)}+\frac {x (7 A-4 B)}{2 a^2}-\frac {(A-B) \sin (c+d x) \cos (c+d x)}{3 d (a \sec (c+d x)+a)^2} \]
[In]
[Out]
Rule 8
Rule 2715
Rule 2717
Rule 3872
Rule 4105
Rubi steps \begin{align*} \text {integral}& = -\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \frac {\cos ^2(c+d x) (a (5 A-2 B)-3 a (A-B) \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{3 a^2} \\ & = -\frac {(8 A-5 B) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \cos ^2(c+d x) \left (3 a^2 (7 A-4 B)-2 a^2 (8 A-5 B) \sec (c+d x)\right ) \, dx}{3 a^4} \\ & = -\frac {(8 A-5 B) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(2 (8 A-5 B)) \int \cos (c+d x) \, dx}{3 a^2}+\frac {(7 A-4 B) \int \cos ^2(c+d x) \, dx}{a^2} \\ & = -\frac {2 (8 A-5 B) \sin (c+d x)}{3 a^2 d}+\frac {(7 A-4 B) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(8 A-5 B) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {(7 A-4 B) \int 1 \, dx}{2 a^2} \\ & = \frac {(7 A-4 B) x}{2 a^2}-\frac {2 (8 A-5 B) \sin (c+d x)}{3 a^2 d}+\frac {(7 A-4 B) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(8 A-5 B) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(315\) vs. \(2(143)=286\).
Time = 1.96 (sec) , antiderivative size = 315, normalized size of antiderivative = 2.20 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (36 (7 A-4 B) d x \cos \left (\frac {d x}{2}\right )+36 (7 A-4 B) d x \cos \left (c+\frac {d x}{2}\right )+84 A d x \cos \left (c+\frac {3 d x}{2}\right )-48 B d x \cos \left (c+\frac {3 d x}{2}\right )+84 A d x \cos \left (2 c+\frac {3 d x}{2}\right )-48 B d x \cos \left (2 c+\frac {3 d x}{2}\right )-381 A \sin \left (\frac {d x}{2}\right )+264 B \sin \left (\frac {d x}{2}\right )+147 A \sin \left (c+\frac {d x}{2}\right )-120 B \sin \left (c+\frac {d x}{2}\right )-239 A \sin \left (c+\frac {3 d x}{2}\right )+164 B \sin \left (c+\frac {3 d x}{2}\right )-63 A \sin \left (2 c+\frac {3 d x}{2}\right )+36 B \sin \left (2 c+\frac {3 d x}{2}\right )-15 A \sin \left (2 c+\frac {5 d x}{2}\right )+12 B \sin \left (2 c+\frac {5 d x}{2}\right )-15 A \sin \left (3 c+\frac {5 d x}{2}\right )+12 B \sin \left (3 c+\frac {5 d x}{2}\right )+3 A \sin \left (3 c+\frac {7 d x}{2}\right )+3 A \sin \left (4 c+\frac {7 d x}{2}\right )\right )}{48 a^2 d (1+\cos (c+d x))^2} \]
[In]
[Out]
Time = 1.04 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.62
method | result | size |
parallelrisch | \(\frac {-163 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\frac {12 \left (A -B \right ) \cos \left (2 d x +2 c \right )}{163}-\frac {3 A \cos \left (3 d x +3 c \right )}{163}+\left (A -\frac {112 B}{163}\right ) \cos \left (d x +c \right )+\frac {140 A}{163}-\frac {92 B}{163}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+168 d \left (A -\frac {4 B}{7}\right ) x}{48 a^{2} d}\) | \(88\) |
derivativedivides | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} A}{3}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}-7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\frac {4 \left (-\frac {5 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+4 \left (-\frac {3 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+2 \left (7 A -4 B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(131\) |
default | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} A}{3}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}-7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\frac {4 \left (-\frac {5 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+4 \left (-\frac {3 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+2 \left (7 A -4 B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(131\) |
norman | \(\frac {\frac {\left (7 A -4 B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {\left (7 A -4 B \right ) x}{2 a}+\frac {\left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 a d}+\frac {\left (7 A -4 B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a}-\frac {\left (13 A -9 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}-\frac {\left (19 A -13 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 a d}-\frac {\left (71 A -41 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{6 a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} a}\) | \(181\) |
risch | \(\frac {7 A x}{2 a^{2}}-\frac {2 x B}{a^{2}}-\frac {i A \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 a^{2} d}+\frac {i A \,{\mathrm e}^{i \left (d x +c \right )}}{a^{2} d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B}{2 a^{2} d}-\frac {i A \,{\mathrm e}^{-i \left (d x +c \right )}}{a^{2} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a^{2} d}+\frac {i A \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 a^{2} d}-\frac {2 i \left (12 A \,{\mathrm e}^{2 i \left (d x +c \right )}-9 B \,{\mathrm e}^{2 i \left (d x +c \right )}+21 \,{\mathrm e}^{i \left (d x +c \right )} A -15 B \,{\mathrm e}^{i \left (d x +c \right )}+11 A -8 B \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}\) | \(207\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.97 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {3 \, {\left (7 \, A - 4 \, B\right )} d x \cos \left (d x + c\right )^{2} + 6 \, {\left (7 \, A - 4 \, B\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (7 \, A - 4 \, B\right )} d x + {\left (3 \, A \cos \left (d x + c\right )^{3} - 6 \, {\left (A - B\right )} \cos \left (d x + c\right )^{2} - {\left (43 \, A - 28 \, B\right )} \cos \left (d x + c\right ) - 32 \, A + 20 \, B\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {\int \frac {A \cos ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 283 vs. \(2 (133) = 266\).
Time = 0.35 (sec) , antiderivative size = 283, normalized size of antiderivative = 1.98 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=-\frac {A {\left (\frac {6 \, {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {42 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} - B {\left (\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {24 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} + \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{6 \, d} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.15 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {\frac {3 \, {\left (d x + c\right )} {\left (7 \, A - 4 \, B\right )}}{a^{2}} - \frac {6 \, {\left (5 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \]
[In]
[Out]
Time = 13.65 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.08 \[ \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx=\frac {x\,\left (7\,A-4\,B\right )}{2\,a^2}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,\left (A-B\right )}{2\,a^2}+\frac {4\,A-2\,B}{2\,a^2}\right )}{d}-\frac {\left (5\,A-2\,B\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (3\,A-2\,B\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^2\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (A-B\right )}{6\,a^2\,d} \]
[In]
[Out]